Lightweight automatic resource management for Scala