A Chicago police officer's gun was found unattended in a courthouse bathroom Thursday morning, prompting an internal investigation, authorities said.