Fix few issues in service_instance and make it flake8 compatible

Change creation order - previously there could be
situation where object would be created but it's resource_id was
unset resulting in it being impossible to delete by heat.

Change-Id: Iebdbd93634ecca243d5ffb13a97b3c40809b2881