Police: Man exposes self in library