Check if there is disk space available

Based on <http://stackoverflow.com/a/16708764/96588>.