Prefer to let exceptions bubble up rather than calling System.exit()
outside of main().
Modified device manager to be AutoCloseable, makings its lifecycle
management even more concise.