safe is_file() for php 5.4