A Polish photojournalist kidnapped in Syria three months ago is home after escaping from his captors, Poland's foreign ministry says.