build: add directory upload support

Some applications like to have a pre-created directory hierarchy
when they start up. Teach Capstan how to upload directories to the
application image.

Signed-off-by: James Peach <jorgar@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
capstan: only make a single rootfs replacement

We know that each path in a rootfs will begin with the rootfs prefix.
We only want to replace the prefix occurrence of the roofs prefix
not any subsequent occurrences, otherwise we will mangle file names.

Signed-off-by: James Peach <jorgar@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>