Fix file upload when memory_limit in php configured to have no limits.

When php configured to have no memory limit then memory_limit directive has value -1. We should keep in mind this behavior when calculating limits.