[ticket/12755] Add timeout to remote upload to prevent infinite loop

Ticket: https://tracker.phpbb.com/browse/PHPBB3-12755
Maybe we should display timeout error instead of empty remote data?