Scotland's oldest working theatre, the Theatre Royal in Dumfries built in 1792, has been saved from closure with support from the local charitable Holywood Trust.