Add ostestr as a function
Add ostestr as a function

The new entry point is created to allow external python programs,
to call ostestr without using an execve(2), and get the same
functionalty as using it form command line.

ostestr expected to work if it called multiple times in a
sequence. Parallel usage is not considered, but is similary safe as
the underlaying test(r) commands.

The explicit exit calls get replaced by returns.

Change-Id: I8efa495347a6956ef0a188063e6f474a4bbe8101

openstack/os-testr