ubuild: implement separate compile_dir directory variable support

Using a separate directory for temporary data such as the compilation
directory makes possible to use temporary filesystems for the purpose.