Import patch to bugfix from Padrino Helpers

Padrino had an issue https://github.com/padrino/padrino-framework/issues/1582
which was solved at https://github.com/padrino/padrino-framework/commit/72769fe39a2f6368a474e05102cb7c35c5fdc685#diff-526024418d0d573e08d46ba3d55c02bcR36

This commit brings the same fix back into Middleman's method that
overrides Padrino's method.
Merge pull request #1401 from claudiob/bring-fix-1582-from-padrino-against-v3-stable

Import patch to bugfix from Padrino Helpers