A man holding hostages inside a building in California that houses a bank branch and school district office has been shot and killed by the FBI.